
import sys,os

#dictd = {"uniqueId":14117268,"sectionId":340852,"channelName":"这就是中国","programName":"第10集 民主模式的国际比较","duration":3005.0,"updateTime":1.57925020432E9,"channelId":340852,"type":1,"sequence":0,"startTime":0.0,"endTime":0.0,"createTime":1600524572412,"isFree":true1}
#print(type(dictd))
datFile = open("download.dat","r",encoding="UTF-8")
for linet in datFile.readlines():
	#line = linet.replace('\"','' )
	line = linet[0:-16]+'}'
	dataDict = eval(line)
	
	print(type(dataDict))

	#print(dataDict.keys())
	#print(dataDict["channelName"])
	fileName = dataDict["channelName"] + "_" + dataDict["programName"]
	#print(fileName)
	fileNo = dataDict["uniqueId"]
	os.rename('%d' %fileNo,fileName + ".mp3")
	#print(fileNo)
	#print()
	
print("read file end")	
datFile.close()
